package ControlLayer;
import java.util.ArrayList;
import ModelLayer.*;

//model layer package has to be imported
/**
 * Controller class for the DVD collection
 * 
 * @author (kbh) 
 * @version (2005.03.31)
 * @revised version English (Ab)
 * (FEN): 2006.03.21: Some changes to the architecture in order to assure layering
 *                    and loose coupling
 */
public class DVDCtr
{
    //declare instance variables to reference containers
    //passed as arguments from the main class
    private DvdContainer dvdContainer;
    
    
    /**
     * Constructor for objects of class DVDCtr
     */
    public DVDCtr()//DVD container is to be passed as parameter from the main controller
    {
       dvdContainer = new DvdContainer();  
    }
    
    //Dummy implementation: after implementing the model layer 
    //objects of class DVD are to be returned, not String
   public void findDVD( int no){
        //this method is to search the container for a DVD
        //with an id-number equal to the parameter no
        //when the dvd is found, the method is to call print-methods in the TUI layer
        dvdContainer.printDvdInfo(no);
        
   }
    
   public int titelToId(String titel){
       int id = 0;
       id = dvdContainer.titelToId(titel);
       return id;       
   }
   
   public void createDVD(int id,String titel,String artist,int releaseYear){
        Dvd dvd = new Dvd(id,titel,artist,releaseYear); 
        dvdContainer.addDvd(dvd);
    }
    
   
   public void deleteDVD(int id){
        dvdContainer.removeDvd(id);
   }
      
    
   public void createCopy(int id){
        //create a copy of the specified dvd and add it to the dvd
   }
    
    
    public void listAllDvds(){
          dvdContainer.printAllDvds();

    }
}
